import { PageContainer } from "@ant-design/pro-layout";
import useCommonTable from "@/hooks/useCommonTable";
import { fetchList, remove } from "@/api/user";
import { Avatar, Button } from "antd";

export default () => {
  const columns = [
    {
      title: "会员ID",
      dataIndex: "openId",
      width: 150,
    },
    {
      title: "昵称",
      dataIndex: "nickName",
      width: 150,
    },
    {
      title: "头像",
      dataIndex: "avatar",
      width: 150,
      search: false,
      render: (_, record) => {
        return <Avatar src={record.avatar}></Avatar>;
      },
    },
    { title: "电话", dataIndex: "mobile", width: 150 },

    {
      title: "成为团长次数",
      dataIndex: "headGroupCount",
      width: 150,
      search: false,
    },
    { title: "获得总佣金预估", dataIndex: "money", width: 150, search: false },
    { title: "爽约次数", dataIndex: "num", width: 150, search: false },
  ];
  return (
    <PageContainer>
      {useCommonTable({
       
        columns,
        renderEdit: (record, actionRef) => {
          return (
            <Button
              danger
              type="primary"
              onClick={async () => {
                // const res = await updateStatus({ id: record.id, status: 2 });
              }}
            >
              拉黑团长
            </Button>
          );
        },
        modalWidth: 700,
        params: {
          headGroup: 1,
        },
        fetchList,
        renderAdd: () => {},
        layout: "horizontal",
        actionColumnWidth: 200,
        showCheckbox: false,
      })}
    </PageContainer>
  );
};
